<div class="site-tree">
    <div class="layui-form" style="height: 38px; margin: 10px 13px 0 0;">
        <select lay-filter="tabVersion">
            {volist name='versions' id='v'}
            <option value="{$key}" <?php echo (input('version') == $key) ? 'selected' : ''; ?>>{$v.name}</option>
            {/volist}
        </select>
    </div>
    <ul class="layui-tree">
{assign name="theShowK" value="0" /}

        {if(isset($document))}
        <li><h2>序言</h2></li>
        {volist name="document" id='v'}
        <li class="site-tree-noicon <?php echo (input('name') == $key) ? 'on' : ''; ?>">
            <a href="/doc/document?name={$key}">
                <cite>{$v.name}</cite>
            </a>
        </li>
        {/volist}
        {/if}
        {volist name='menu' id='v' key="k"}
        <li>
            <h2 class="<?php echo (input('name') == $v['class']) ? 'on' : ''; ?> showK showK{$k}" val="{$k}" >
                <!--
                <a href="/doc/module?name={$v.class}" style="display:initial;font-size: inherit">{$v.title}</a>
                -->
                {$v.title}
            </h2>
            
        </li>
        {if(isset($v.action))}
        {volist name="v.action" id='m'}
        
        {if input('name') == $m['href']}
          {assign name="theShowK" value="$k" /}
        {/if}
        
        <li <?php echo (input('name') == $v['class']) ? '' : 'style="display:none"'; ?> class="show{$k} show0 site-tree-noicon <?php echo (input('name') == $m['href']) ? 'on' : ''; ?>">
            <a href="/doc/action?name={$m.href}&version={:input('version',0,'intval')}">
                <em>
                    {if(isset($m.version))}<span class="layui-badge layui-bg-blue">{$m.version}</span>{/if}
                </em>
                <cite>{$m.title}</cite>
                {if(isset($m.dot) && $m.dot == 1)}
                <span class="layui-badge-dot"></span>
                {/if}

            </a>
        </li>
        {/volist}
        {/if}
        {/volist}
    </ul>
</div>

